<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增资金落实记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-invest-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">项目ID：</label>
                <div class="col-sm-8">
                    <input name="projectId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">总投资：</label>
                <div class="col-sm-8">
                    <input name="totalInvest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">完成投资：</label>
                <div class="col-sm-8">
                    <input name="doneInvest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实际到位资金：</label>
                <div class="col-sm-8">
                    <input name="actualInvest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">计划投资：</label>
                <div class="col-sm-8">
                    <input name="planInvest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">资金需求：</label>
                <div class="col-sm-8">
                    <input name="fundDemand" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注信息：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "manage/invest"

        function submitHandler() {
            var validateResult = $("#form-invest-edit").validate({
                rules: {
                    totalInvest: {
                        required: true,
                        number: true,
                        gt: 0
                    },
                    doneInvest: {
                        required: true,
                        number: true,
                        gt: 0
                    },
                    actualInvest: {
                        required: true,
                        number: true,
                        gt: 0
                    },
                    planInvest: {
                        required: true,
                        number: true,
                        gt: 0
                    },
                    fundDemand: {
                        required: true,
                        number: true,
                        gt: 0
                    }
                }
            }).form();
            if (validateResult) {
                $.operate.save(prefix + "/add", $('#form-invest-add').serialize());
            } else {
                $.modal.msgError("请完善内容");
            }
        }
    </script>
</body>
</html>